home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / ZZFP4F (.txt) < prev   
Encoding:
Java Class File  |  1998-09-16  |  6.7 KB  |  221 lines

  1. package com.sun.java.swing;
  2.  
  3. import com.sun.java.accessibility.Accessible;
  4. import com.sun.java.accessibility.AccessibleComponent;
  5. import com.sun.java.accessibility.AccessibleContext;
  6. import com.sun.java.accessibility.AccessibleRole;
  7. import com.sun.java.accessibility.AccessibleState;
  8. import com.sun.java.accessibility.AccessibleStateSet;
  9. import com.sun.java.swing.border.Border;
  10. import com.sun.java.swing.border.TitledBorder;
  11. import java.awt.Color;
  12. import java.awt.Container;
  13. import java.awt.Cursor;
  14. import java.awt.Dimension;
  15. import java.awt.Font;
  16. import java.awt.FontMetrics;
  17. import java.awt.Point;
  18. import java.awt.Rectangle;
  19. import java.awt.event.FocusListener;
  20. import java.awt.event.MouseEvent;
  21. import java.io.Serializable;
  22. import java.util.Locale;
  23.  
  24. public abstract class JComponent$AccessibleJComponent extends AccessibleContext implements Serializable, AccessibleComponent {
  25.    // $FF: synthetic field
  26.    JComponent this$0;
  27.  
  28.    public String getAccessibleName() {
  29.       if (super.accessibleName != null) {
  30.          return super.accessibleName;
  31.       } else {
  32.          Border border = this.this$0.getBorder();
  33.          return border != null && border instanceof TitledBorder ? ((TitledBorder)border).getTitle() : null;
  34.       }
  35.    }
  36.  
  37.    public String getAccessibleDescription() {
  38.       if (super.accessibleDescription != null) {
  39.          return super.accessibleDescription;
  40.       } else {
  41.          try {
  42.             String ttt = this.this$0.getToolTipText((MouseEvent)null);
  43.             if (ttt != null) {
  44.                return ttt;
  45.             }
  46.          } catch (Exception var2) {
  47.          }
  48.  
  49.          return null;
  50.       }
  51.    }
  52.  
  53.    public AccessibleRole getAccessibleRole() {
  54.       return AccessibleRole.SWING_COMPONENT;
  55.    }
  56.  
  57.    public AccessibleStateSet getAccessibleStateSet() {
  58.       return SwingUtilities.getAccessibleStateSet(this.this$0);
  59.    }
  60.  
  61.    public Accessible getAccessibleParent() {
  62.       if (super.accessibleParent != null) {
  63.          return super.accessibleParent;
  64.       } else {
  65.          Container parent = this.this$0.getParent();
  66.          return parent instanceof Accessible ? (Accessible)parent : null;
  67.       }
  68.    }
  69.  
  70.    public int getAccessibleIndexInParent() {
  71.       return SwingUtilities.getAccessibleIndexInParent(this.this$0);
  72.    }
  73.  
  74.    public int getAccessibleChildrenCount() {
  75.       return SwingUtilities.getAccessibleChildrenCount(this.this$0);
  76.    }
  77.  
  78.    public Accessible getAccessibleChild(int i) {
  79.       return SwingUtilities.getAccessibleChild(this.this$0, i);
  80.    }
  81.  
  82.    public Locale getLocale() {
  83.       return this.this$0.getLocale();
  84.    }
  85.  
  86.    public AccessibleComponent getAccessibleComponent() {
  87.       return this;
  88.    }
  89.  
  90.    public Color getBackground() {
  91.       return this.this$0.getBackground();
  92.    }
  93.  
  94.    public void setBackground(Color c) {
  95.       this.this$0.setBackground(c);
  96.    }
  97.  
  98.    public Color getForeground() {
  99.       return this.this$0.getForeground();
  100.    }
  101.  
  102.    public void setForeground(Color c) {
  103.       this.this$0.setForeground(c);
  104.    }
  105.  
  106.    public Cursor getCursor() {
  107.       return this.this$0.getCursor();
  108.    }
  109.  
  110.    public void setCursor(Cursor cursor) {
  111.       this.this$0.setCursor(cursor);
  112.    }
  113.  
  114.    public Font getFont() {
  115.       return this.this$0.getFont();
  116.    }
  117.  
  118.    public void setFont(Font f) {
  119.       this.this$0.setFont(f);
  120.    }
  121.  
  122.    public FontMetrics getFontMetrics(Font f) {
  123.       return this.this$0.getFontMetrics(f);
  124.    }
  125.  
  126.    public boolean isEnabled() {
  127.       return this.this$0.isEnabled();
  128.    }
  129.  
  130.    public void setEnabled(boolean b) {
  131.       boolean old = this.this$0.isEnabled();
  132.       this.this$0.setEnabled(b);
  133.       if (b != old && this.this$0.accessibleContext != null) {
  134.          if (b) {
  135.             this.this$0.accessibleContext.firePropertyChange("AccessibleState", (Object)null, AccessibleState.ENABLED);
  136.          } else {
  137.             this.this$0.accessibleContext.firePropertyChange("AccessibleState", AccessibleState.ENABLED, (Object)null);
  138.          }
  139.       }
  140.  
  141.    }
  142.  
  143.    public boolean isVisible() {
  144.       return this.this$0.isVisible();
  145.    }
  146.  
  147.    public void setVisible(boolean b) {
  148.       boolean old = this.this$0.isVisible();
  149.       this.this$0.setVisible(b);
  150.       if (b != old && this.this$0.accessibleContext != null) {
  151.          if (b) {
  152.             this.this$0.accessibleContext.firePropertyChange("AccessibleState", (Object)null, AccessibleState.VISIBLE);
  153.          } else {
  154.             this.this$0.accessibleContext.firePropertyChange("AccessibleState", AccessibleState.VISIBLE, (Object)null);
  155.          }
  156.       }
  157.  
  158.    }
  159.  
  160.    public boolean isShowing() {
  161.       return this.this$0.isShowing();
  162.    }
  163.  
  164.    public boolean contains(Point p) {
  165.       return this.this$0.contains(p);
  166.    }
  167.  
  168.    public Point getLocationOnScreen() {
  169.       return this.this$0.isShowing() ? this.this$0.getLocationOnScreen() : null;
  170.    }
  171.  
  172.    public Point getLocation() {
  173.       return this.this$0.getLocation();
  174.    }
  175.  
  176.    public void setLocation(Point p) {
  177.       this.this$0.setLocation(p);
  178.    }
  179.  
  180.    public Rectangle getBounds() {
  181.       return this.this$0.getBounds();
  182.    }
  183.  
  184.    public void setBounds(Rectangle r) {
  185.       this.this$0.setBounds(r);
  186.    }
  187.  
  188.    public Dimension getSize() {
  189.       return this.this$0.getSize();
  190.    }
  191.  
  192.    public void setSize(Dimension d) {
  193.       this.this$0.setSize(d);
  194.    }
  195.  
  196.    public Accessible getAccessibleAt(Point p) {
  197.       return SwingUtilities.getAccessibleAt(this.this$0, p);
  198.    }
  199.  
  200.    public boolean isFocusTraversable() {
  201.       return this.this$0.isFocusTraversable();
  202.    }
  203.  
  204.    public void requestFocus() {
  205.       this.this$0.requestFocus();
  206.    }
  207.  
  208.    public void addFocusListener(FocusListener l) {
  209.       this.this$0.addFocusListener(l);
  210.    }
  211.  
  212.    public void removeFocusListener(FocusListener l) {
  213.       this.this$0.removeFocusListener(l);
  214.    }
  215.  
  216.    // $FF: synthetic method
  217.    public JComponent$AccessibleJComponent(JComponent this$0) {
  218.       this.this$0 = this$0;
  219.    }
  220. }
  221.